1. The season_code and season_desc were off by one.

This is how we fixed it:


In [5]:
import pandas as pd

In [6]:
data = pd.read_table('daily_weather.tsv')

In [7]:
for i, row in enumerate(data['season_desc']):
    if row == 'Spring':
        data.set_value(i, 'season_desc', 'Winter')
    elif row == 'Summer':
        data.set_value(i, 'season_desc', 'Spring')
    elif row == 'Fall':
        data.set_value(i, 'season_desc', 'Summer')
    elif row == 'Winter':
        data.set_value(i, 'season_desc', 'Fall')

In [8]:
data.groupby('season_desc')['temp'].mean()


Out[8]:
season_desc
Fall      0.419368
Spring    0.554557
Summer    0.711445
Winter    0.321700
Name: temp, dtype: float64

In [ ]: